www.gusucode.com > VC 3D弹道仿真程序源码文件-源码程序 > VC 3D弹道仿真程序源码文件-源码程序/code/AeroParam.cpp

    //Download by http://www.NewXing.com
#include <math.h>
#include "AeroParam.h"
#include  <iostream.h>

#define DIM_MA 11
#define NUM_MA 19
#define NUM_ALPHA 10
#define NUM_ma 19

const double PI=3.1415926;
const double RAD=180./PI;

extern double D, LB, S_ref;
 //求一元三点不等距插值及插微商
extern void Interp1( int n, double A[], double* p, double x, double* result, int flag );    
extern void Interp2( int M, int N, const double A[], const double B[], double *C, double X, double Y, double *Z );
//LARx //求二元三点不等距插值

CAeroParam::CAeroParam()
{

}

CAeroParam::~CAeroParam()
{
}

double CAeroParam::Get_Latitude (double latitude, double x, double y, double z, double r )
{
	double R0, R0x, R0y, R0z,fl,old_l;
		
	extern double we;

	R0 = 6378140;

	R0z=0;	R0x=-R0*sin(0);  R0y=R0*cos(0);

/////////////////////////////////////////////////////////////////////////////

	old_l=latitude;

	while (latitude < 1.6)	   
	{	
		fl=latitude-asin(  ( (x+R0x)*we*cos( latitude ) + (y+R0y)*we*sin( latitude ) )/ (r*we)   );

		if( fabs(fl)<2e-2 ) 
		{
			if( latitude <=old_l)
			{
			//	cout<< latitude <<endl; 
				latitude+=0.0000009;
			
			continue;
			}
			else
				break;
		}

		else
			latitude+=0.0000009;
	}
	return latitude;
}